﻿@{
    Bundle("jquery_validate");
}

<script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('@ID("#form")').validate({
            rules: {
                displayName: {
                    required: true
                }
            }
        });
    });
</script>
<form id="@ID("form")" action="@Url.Action(Loc.Act("Update").Ctrl("Seller"))" method="post">
    <input type="hidden" name="flags" value="None" />
    <table>
        <tr>
            <td>
                <label>#</label>
            </td>
            <td>
                <input type="text" readonly name="id" value="@JDM.Int32(Model.EntityID)" />
            </td>
        </tr>
        <tr>
            <td>
                <label>&#10001;</label>
            </td>
            <td>
                <input type="text" readonly value="@Svc.DateTime((DateTime)JDM.DateTime(Model.CreatedOn))" />
            </td>
        </tr>
        <tr>
            <td>
                <label>&#10002;</label>
            </td>
            <td>
                <input type="text" readonly value="@Svc.DateTime((DateTime)JDM.DateTime(Model.UpdatedOn))" />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.Name("CommentCount"))</label>
            </td>
            <td>
                <input type="text" readonly value="@JDM.Int32(Model.CommentCount)" />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.Name("RatingCount"))</label>
            </td>
            <td>
                <input type="text" readonly value="@JDM.Int32(Model.RatingCount)" />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.Name("RatingAverage"))</label>
            </td>
            <td>
                <input type="text" readonly value="@JDM.Byte(Model.RatingAverage)" />
            </td>
        </tr>
        <tr>
            <td>
                <a href="@Url.Action(Loc.Act("Edit").Ctrl("Account").Area("Membership").Set(new
                {
                    id = JDM.Int32(Model.Account.EntityID)
                }))" class="ui-icon ui-icon-extlink"></a>
                <label>@T(Res.Name("Account"))</label>
            </td>
            <td>
                <input type="text" readonly value="@JDM.String(Model.Account.Email)" />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.Name("DisplayName"))</label>
            </td>
            <td>
                <input type="text" name="displayName" value="@JDM.String(Model.DisplayName)" maxlength="100" />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.In("API").Of("Enum").Of("SellerFlags").Name("Active"))</label>
            </td>
            <td>
                <input type="checkbox" name="flags" value="Active" @(JDM.HasFlags(Model.Flags, "Active") ? "checked" : String.Empty) />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.In("API").Of("Enum").Of("CatalogSellerFlags").Name("RatingAllowed"))</label>
            </td>
            <td>
                <input type="checkbox" name="flags" value="RatingAllowed" @(JDM.HasFlags(Model.Flags, "RatingAllowed") ? "checked" : String.Empty) />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.In("API").Of("Enum").Of("CatalogSellerFlags").Name("AnonRatingAllowed"))</label>
            </td>
            <td>
                <input type="checkbox" name="flags" value="AnonRatingAllowed" @(JDM.HasFlags(Model.Flags, "AnonRatingAllowed") ? "checked" : String.Empty) />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.In("API").Of("Enum").Of("CatalogSellerFlags").Name("CommentAllowed"))</label>
            </td>
            <td>
                <input type="checkbox" name="flags" value="CommentAllowed" @(JDM.HasFlags(Model.Flags, "CommentAllowed") ? "checked" : String.Empty) />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.In("API").Of("Enum").Of("CatalogSellerFlags").Name("AnonCommentAllowed"))</label>
            </td>
            <td>
                <input type="checkbox" name="flags" value="AnonCommentAllowed" @(JDM.HasFlags(Model.Flags, "AnonCommentAllowed") ? "checked" : String.Empty) />
            </td>
        </tr>
    </table>
    <ul class="bar toolbar">
        <li><button class="button" type="submit">@T(Res.In("Common").Of("Act").Name("Submit"))</button></li>
    </ul>
</form>